Recently, as a Large Scale Integration (LSI) pattern size is getting finer, a pattern image that is formed on a photomask, such as a reticle, has been getting finer. As a result, the minimum size of a defect that needs to be detected, such as a defect on a pattern image, is getting finer, so that when comparing a pattern image and a reference pattern image to detect a defect on the pattern image, it needs to detect a deviation of pixel position between the pattern image and the reference pattern image, expansion-contraction and waviness of the pattern image, and a defect that may be buried in sensing noise.
For this reason, according to conventional technologies, as preprocessing of comparing a pattern image and a reference image, alignment on a per-pixel basis is performed, and then image corrections, such as resizing correction, expansion-contraction and waviness correction, and noise averaging processing, of the pattern image are performed.
However, according to the alignment on a per-pixel basis as described above according to the conventional technology, there is a possibility that the alignment ends in failure.